#include <stdio.h>

int main(int argc, char *argv[])
{
	int a[5001], n, i, j;

	scanf("%d", &n);

	for (i=1; i<n; i++) a[i] = 1;

	a[1] = 0;
	for (i=2; i<=n; i++) {
		if (a[i] == 1) {
			for (j=i*2; j<n; j+=i) {
				a[j] = 0;
			}
		}
	}

	for (i=2; i<n; i++) {
		if (a[i] == 1) printf("%d  ", i);
	}
	printf("\n");

	return 0;
}
